package com.create.factorypatterm.abstractfactory;

public class SimpleAndAbstractFactory{
	
	public static BenzCar createBenzCar(String car) throws Exception{
		return (BenzCar)Class.forName(car).newInstance();
	}

	public static BmwCar createBmwCar(String car) throws Exception {
		return (BmwCar)Class.forName(car).newInstance();
	}

	public static void main(String[] args) {
		try {
			BenzCar car = createBenzCar("com.create.factorypatterm.abstractfactory.SUVBenzCar");
			car.create();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}